package collection;

import java.util.HashMap;
import java.util.Scanner;

class Person{
	String name;
	String phone;
	
	public Person(String a,String b){
		this.name=a;
		this.phone=b;
	}

	public String getName() {
		return name;
	}

	public String getPhone() {
		return phone;
	}
	
}
public class Test02_Map {
	public static void main(String[] args){
		Person per1 = new Person("김김김","010123456");
		Person per2 = new Person("구구구","056767456");
		Person per3 = new Person("홍홍홍","011234534");
		
		HashMap<String, Person> map = new HashMap<String,Person>();
		map.put(per1.getName(), per1);
		map.put(per2.getName(), per2);
		map.put(per3.getName(), per3);//공부해요 빨리 놀지말고
		
		System.out.println("이름쳐!!!!");
		Scanner scan = new Scanner(System.in);
		String find = scan.next();
		
		Person per = map.get(find);
		if(per!=null){
			System.out.println("이름:"+per.getName()+",전화번호:"+per.getPhone());
			
		}else{
			System.out.println("다른이름쳐 읍구만");
		}
		
	}
}
